// eslint-disable-next-line no-unused-vars
import { config, apiConfig, globalConfig } from './config';

export function createCityPolygonLine(geoJSON, type) {
  const Polyline = config.ALoca.createPolyline({
    style: {
      strokeColor: 'rgb(63,222,230)',
      strokeWeight: 2,
      strokeOpacity: 1,
      ...globalConfig.polygonLineStyle
    },
    hover: {
      enable: false,
      fillColor: 'red',
      strokeColor: 'red'
    }
  }, geoJSON);

  const Polygon = config.ALoca.createPolygon({
    style: {
      fillOpacity: 0,
      strokeOpacity: 0
    }
  }, geoJSON);

  let ImageLayer = '';

  ImageLayer = new AMap.ImageLayer({
    url: globalConfig.mapNBImageUrl,
    bounds: new AMap.Bounds(
      [120.86704099999997 - 0.21, 29.047449 - 0.5], // ['+（左侧）向右' '+（底部）向上']
      [122.14381800000001 + 0.328, 30.489772 + 0.109] // ['-（右侧）向左' '-（顶部）向下']
    ),
    zooms: [1, 30],
    zIndex: 10
  });

  config.map.add(ImageLayer);

  return {
    Polygon,
    Polyline,
    ImageLayer
  };
}
